package com.ruoyi.popAndHou.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.popAndHou.mapper.PopAndHouMapper;
import com.ruoyi.popAndHou.domain.PopAndHou;
import com.ruoyi.popAndHou.service.IPopAndHouService;

/**
 * 人房关联Service业务层处理
 *
 * @author wang
 * @date 2022-04-20
 */
@Service
public class PopAndHouServiceImpl implements IPopAndHouService
{
    @Autowired
    private PopAndHouMapper popAndHouMapper;

    /**
     * 查询人房关联
     *
     * @param id 人房关联主键
     * @return 人房关联
     */
    @Override
    public PopAndHou selectPopAndHouById(Long id)
    {
        return popAndHouMapper.selectPopAndHouById(id);
    }

    /**
     * 查询人房关联列表
     *
     * @param popAndHou 人房关联
     * @return 人房关联
     */
    @Override
    public List<PopAndHou> selectPopAndHouList(PopAndHou popAndHou)
    {
        return popAndHouMapper.selectPopAndHouList(popAndHou);
    }

    /**
     * 新增人房关联
     *
     * @param popAndHou 人房关联
     * @return 结果
     */
    @Override
    public int insertPopAndHou(PopAndHou popAndHou)
    {
        popAndHou.setCreateTime(DateUtils.getNowDate());
        popAndHou.setCreateBy(SecurityUtils.getUsername());
        return popAndHouMapper.insertPopAndHou(popAndHou);
    }

    /**
     * 修改人房关联
     *
     * @param popAndHou 人房关联
     * @return 结果
     */
    @Override
    public int updatePopAndHou(PopAndHou popAndHou)
    {
        popAndHou.setUpdateTime(DateUtils.getNowDate());
        return popAndHouMapper.updatePopAndHou(popAndHou);
    }

    /**
     * 批量删除人房关联
     *
     * @param ids 需要删除的人房关联主键
     * @return 结果
     */
    @Override
    public int deletePopAndHouByIds(Long[] ids)
    {
        return popAndHouMapper.deletePopAndHouByIds(ids);
    }

    /**
     * 删除人房关联信息
     *
     * @param id 人房关联主键
     * @return 结果
     */
    @Override
    public int deletePopAndHouById(Long id)
    {
        return popAndHouMapper.deletePopAndHouById(id);
    }
}
